package com.eastfair.venueservice.service;

import com.eastfair.boot.service.SuperService;
import com.eastfair.core.base.R;
import com.eastfair.venueservice.dto.BizStateDTO;
import com.eastfair.venueservice.dto.ExhibitionSettlementDTO;
import com.eastfair.venueservice.entity.ExhibitionSettlement;
import com.eastfair.venueservice.vo.ExhibitionSettlementVO;
import com.eastfair.venueservice.vo.ServiceBookingVO;

import java.util.List;

/**
 * <p>
 * 业务接口
 * 结算记录
 * </p>
 *
 * @author linan
 * @date 2023-01-10
 */
public interface ExhibitionSettlementService extends SuperService<ExhibitionSettlement> {

    /**
     * 综合-查询结算记录
     * @param query
     * @return
     */
    List<ExhibitionSettlementVO> queryExhibitionSettlement(ExhibitionSettlementDTO query);

    /**
     * 综合-查询结算明细
     * @param query
     * @return
     */
    ExhibitionSettlementVO queryExhibitionSettlementDetail(ExhibitionSettlementDTO query);

    /**
     * 查询场馆待结算的结算单
     * 综合结算
     * 报馆
     * 加班
     * 报修
     * 违规罚款
     * 保证金
     * <p>
     * 保证金应缴金额：bondAmount
     * 保证金应缴金额：payableBondAmount
     * 罚款金额：violationPunish
     * 优惠金额：discountAmount
     * 已付款金额：received
     * 已开票金额：hasInvoicedAmount
     * 应退款金额：refundAmount
     *
     * @param query the query
     * @return the exhibition settlement vo
     */
    ExhibitionSettlementVO queryWaitVenueExhibitionSettlement(ExhibitionSettlementDTO query);

    /**
     * 查询主场待结算的结算单
     * 主场结算
     * 服务，管理费订单
     * 报修订单
     * 加班
     * 违规罚款
     * 保证金订单
     *
     * 保证金应缴金额：bondAmount
     * 保证金应缴金额：payableBondAmount
     * 罚款金额：violationPunish
     * 优惠金额：discountAmount
     * 已付款金额：received
     * 已开票金额：hasInvoicedAmount
     * 应退款金额：refundAmount
     *
     * @param query the query
     * @return the exhibition settlement vo
     */
    ExhibitionSettlementVO queryWaitHomeExhibitionSettlement(ExhibitionSettlementDTO query);

    /**
     * 取消结算服务项
     * @param dto dto
     * @return Boolean
     */
    Boolean cancelSettlementServiceItem(ExhibitionSettlementDTO dto);

    /**
     * 生成结算单
     * @param dto
     * @return
     */
    Boolean generateSettlement(ExhibitionSettlementDTO dto);

    /**
     * 更新结算单
     * @param dto dto
     * @return Boolean
     */
    Boolean updateSettlement(ExhibitionSettlementDTO dto);

    /**
     * 综合-查询搭建商结算记录
     * @param query query
     * @return List<ExhibitionSettlementVO>
     */
    List<ExhibitionSettlementVO> queryExhibitionSettlementOfBuilder(ExhibitionSettlementDTO query);

    /**
     * 搭建商展位管理申请结算
     * @param dto dto
     * @return Boolean
     */
    Boolean applyForSettlement(ExhibitionSettlementDTO dto);

    /**
     * 综合-查询搭建商结算明细
     * @param query query
     * @return ExhibitionSettlementVO
     */
    ExhibitionSettlementVO queryExhibitionSettlementDetailOfBuilder(ExhibitionSettlementDTO query);

    /**
     * 主场给搭建商生成结算单
     * @param dto
     * @return
     */
    Boolean generateSettlementForBuilder(ExhibitionSettlementDTO dto);

    /**
     * 结算认领
     * @param dto
     * @return
     */
    Boolean settlementCollect(ExhibitionSettlementDTO dto);

    /**
     * 综合-通过公司ID查询结算记录.
     * @param query
     * @return
     */
    List<ExhibitionSettlementVO> queryExhibitionSettlementByCompanyId(ExhibitionSettlementDTO query);

    /**
     * 通过单号查询结算明细
     * @param query
     * @return
     */
    ExhibitionSettlementVO queryDetailBySettlementNo(ExhibitionSettlementDTO query);

    /**
     * 查询结算单下的服务
     * @param settlementNo
     * @return List
     */
    List<ServiceBookingVO> queryServiceBookingListOfOrder(String settlementNo);

    /**
     * 更新订单或结算单退款状态
     *
     * @param bizStateDTO the biz state dto
     * @return boolean
     */
    Boolean updateBizRefundState(BizStateDTO bizStateDTO);

    /**
     * 更新订单或结算单开票状态
     *
     * @param bizStateDTO the biz state dto
     * @return boolean
     */
    Boolean updateBizInvoiceApplyState(BizStateDTO bizStateDTO);

    /**
     * 校验场馆结算状态
     * @param exhibitionSettlementDTO
     */
    void checkSettleState(ExhibitionSettlementDTO exhibitionSettlementDTO);
}
